﻿
namespace Aeon.Emulator.Decoding.Recompiler.StringCompilers
{
    /// <summary>
    /// Generates IL for emulating a LODS instruction.
    /// </summary>
    internal sealed class LodsCompiler : StringBase
    {
        /// <summary>
        /// Initializes a new instance of the LodsCompiler class.
        /// </summary>
        /// <param name="registers">Associated register expression generator.</param>
        public LodsCompiler(RegisterExpressions registers)
            : base(registers, false)
        {
        }

        /// <summary>
        /// Generates the IL for one iteration of the instruction.
        /// </summary>
        protected override void GenerateIteration()
        {
            GenerateAX(GenerateDS_SI);

            IncrementSI();
        }
    }
}
